package com.itgaoshu.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.itgaoshu.bean.Cashier;
import com.itgaoshu.service.LCashService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;

/**
 * \* @author: 李豪杰
 * \* Date: 2021/3/23
 * \* Time: 17:05
 * \* Description:
 * \
 */
@Controller
@RequestMapping("caocc")
public class LCashController {
    @Resource
    private LCashService lcs;
    //查询所有的处方
    @RequestMapping("selpepi")
    @ResponseBody
    public Object selectAllChufang(Integer perid,Integer limit,Integer page){
        List<Cashier> selall = lcs.selpepi(perid);
        PageHelper.startPage(page,limit);
        PageInfo PageInfo = new PageInfo(selall);
        HashMap<String, Object> map = new HashMap<>();
        map.put("code",0);
        map.put("conut",PageInfo.getTotal());
        map.put("msg","");
        map.put("data",PageInfo.getList());
        return map;
    }
}
